import request from '@/utils/request'

// 获取套餐列表
export function getPlanList(params) {
  return request({
    url: '/admin/plans',
    method: 'get',
    params
  })
}

// 获取套餐详情
export function getPlanDetail(planId) {
  return request({
    url: `/admin/plans/${planId}`,
    method: 'get'
  })
}

// 添加套餐
export function addPlan(data) {
  return request({
    url: '/admin/plans/add',
    method: 'post',
    data
  })
}

// 更新套餐
export function updatePlan(planId, data) {
  return request({
    url: `/admin/plans/edit/${planId}`,
    method: 'post',
    data
  })
}

// 删除套餐
export function deletePlan(planId) {
  return request({
    url: `/admin/plans/delete/${planId}`,
    method: 'post'
  })
}

// 更新套餐状态
export function updatePlanStatus(planId, status) {
  return request({
    url: `/admin/plans/update_status/${planId}`,
    method: 'post',
    data: { status }
  })
}

// 更新套餐排序
export function updatePlanOrder(data) {
  return request({
    url: '/admin/plans/update_order',
    method: 'post',
    data
  })
} 